package DesignPattern.Behavior.Visitor;

import java.util.ArrayList;
import java.util.List;

public class Home {
    private List<Animal> animalList = new ArrayList<>();

    public void addAnimal(Animal animal) {
        animalList.add(animal);
    }

    public void action(Person person) {
        for (Animal animal : animalList) {
            animal.accept(person);
        }
    }
}
